package com.practice;

import java.util.Scanner;

public class FlyTicket {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        //Ctrl+Alt+M 自动抽取方法
        double price = getPrice(sc);
        //输入月份
        System.out.println("输入输入月份");
        int month= sc.nextInt();
        //头等舱为true   还是   经济舱false
        System.out.println("输入输入舱类型：");
        boolean tube=sc.nextBoolean();
        System.out.println(Price(price,month,tube));
    }

    private static double getPrice(Scanner sc) {
        //输入机票原价
        System.out.println("输入机票原价");
        double price= sc.nextInt();
        return price;
    }

    public static double Price(double price,int month,boolean tube){
        double finPrice;
        switch (month){
            case 5:
            case 6:
            case 7:
            case 8:
            case 9:
            case 10:
            {
                if (tube)price*=0.9;
                else price*=0.85;
                break;
            }
            case 1:
            case 2:
            case 3:
            case 4:
            case 11:
            case 12:
            {
                if (tube)price*=0.7;
                else price*=0.65;
                break;
            }
            default:
                System.out.println("录入不合法");
        }
        return price;
    }
}
